package com.weixing.mall.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.weixing.mall.provider.model.domain.AgentRebate;
import com.weixing.mall.provider.model.query.AgentRebateQuery;
import com.weixing.mall.provider.model.vo.AgentRebateVo;
import com.weixing.mall.provider.model.vo.AgentRebateWithdrawVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 代理商模块-代理商返利表 Mapper 接口
 * </p>
 *
 * @author Small
 * @since 2019-11-18
 */
public interface AgentRebateMapper extends BaseMapper<AgentRebate> {

    IPage<AgentRebateVo> selectListOfPage(@Param("pg") Page page, @Param("qs")AgentRebateQuery agentRebateQuery);


    IPage<AgentRebateWithdrawVo> getAgentRebateByWithdrawId(@Param("pg") Page page, Long id, Date createdTime);

    List<AgentRebateWithdrawVo> getAgentRebateByWithdrawId(Long id);

    List<AgentRebate> withdrawRebate(long currentUserId,String currentTime);

    BigDecimal selectWithdrawRebate(long currentUserId,String currentTime);

    List<AgentRebate> selectByCreatedTime(Date o, Date createdTime);

    IPage<AgentRebateVo> selctAgentRebateOfPage(@Param("pg")Page initMpPage,  @Param("agentId")Long agentId);

    BigDecimal countRebate(@Param("agentId")long agentId, @Param("month")String month);

}
